import React from 'react';
import { text } from '../../recoils/atoms/index';
import {useSetRecoilState} from "recoil";

function ComponentAState () {

    const setText = useSetRecoilState(text);

    console.log('--useSetRecoilState in recoil--')

    return (<div className="form-group border">
        <h3>useSetRecoilState in recoil</h3>
        <div className="form-group">
            <label htmlFor="span" >useSetRecoilState to change：</label>
            <input type="text"  onChange={event => setText(event.target.value)}/>
        </div>
    </div>)
}

export default React.memo(ComponentAState);